/**
 * 
 */
package org.t2.backstage.module.gameserver.model;

import org.banish.sql.core.annotation.Column;
import org.banish.sql.core.annotation.Id;
import org.banish.sql.core.annotation.Index;
import org.banish.sql.core.annotation.Table;
import org.banish.sql.core.annotation.Id.Strategy;
import org.banish.sql.core.annotation.enuma.IndexType;
import org.gaming.service.repository.annotation.NoCache;
import org.gaming.service.service.redis.OneToManyEntity;
import org.springframework.stereotype.Repository;

/**
 * @author YY
 *
 */
@Repository
@NoCache(relation = { "channelId", "regionId" })
@Table(comment = "游戏大区表", dbAlias = "backstage", indexs = {
		@Index(fields = { "channelId", "regionId" }, type = IndexType.UNIQUE) })
public class GameRegion extends OneToManyEntity {
	@Id(strategy = Strategy.AUTO, autoBase = 1)
	@Column(comment = "数据唯一ID")
	private long id;
	@Column(comment = "大区ID")
	private int regionId;
	@Column(comment = "大区名称")
	private String name;
	@Column(comment = "渠道ID", readonly = true)
	private long channelId;
	@Column(comment = "渠道名字")
	private String channelName;
	@Column(comment = "服务器类型，1测试服，2审核服，3正式服")
	private int serverType;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public Long redisOwnerKey() {
		return channelId;
	}
	@Override
	public Long redisHashKey() {
		return (long)regionId;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getChannelId() {
		return channelId;
	}
	public void setChannelId(long channelId) {
		this.channelId = channelId;
	}
	public int getRegionId() {
		return regionId;
	}
	public void setRegionId(int regionId) {
		this.regionId = regionId;
	}
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}
	public int getServerType() {
		return serverType;
	}
	public void setServerType(int serverType) {
		this.serverType = serverType;
	}
}
